<html>
<head lang="en">
    <meta charset="utf-8">
    <title>ECharts</title>
    <style type="text/css">
        #main{height:400px;width: 1000px}
    </style>
    <script src="echarts.js"></script>
</head>
<body>
<div id="main">

</div>
<script type="text/javascript">
    // 基于准备好的dom，初始化 echarts 实例并绘制图表。
    var myChart = echarts.init(document.getElementById("main"));
    // 指定图表的配置项和数据
    var data = [
  {
    name: '祖母',
    children: [
      {
        name: '张阿姨',
        value: 15,
        children: [
          {
            name: '姐妹 Jane',
            value: 2
          },
          {
            name: '姐妹 Mary',
            value: 5,
            children: [
              {
                name: '女儿 Jane',
                value: 2
              }
            ]
          },
          {
            name: '姐妹 Ben',
            value: 4
          }
        ]
      },
      {
        name: '妈妈',
        value: 10,
        children: [
          {
            name: 'Me',
            value: 5
          },
          {
            name: '姐妹 Peter',
            value: 1
          }
        ]
      }
    ]
  },
  {
    name: '祖父',
    children: [
      {
        name: '李阿姨',
        children: [
          {
            name: '姐妹 Betty',
            value: 1
          },
          {
            name: '姐妹 Jenny',
            value: 2
          }
        ]
      }
    ]
  }
];
option = {
  series: {
    type: 'sunburst',
    // emphasis: {
    //     focus: 'ancestor'
    // },
    data: data,
    radius: [0, '88%'],
    label: {
      rotate: 'radial'
    }
  }
};
    myChart.setOption(option);


    // 使用刚指定的配置项和数据显示图表
    myChart.setOption(option);
    
</script>
</body>
</html>
